<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script type="text/javascript">

function Validate()
{
	var no=/^[0-9.]+$/;
	var na =/^[a-zA-Z.]+$/;
	if(document.gedtechadd.make.value=="")
	{
		alert("Gadget Make Missing");
		document.gedtechadd.make.focus();
		return false;
	}
	if(!no.test(document.gedtechadd.price.value))
		{
		alert("Gadget Price Missing");
		document.gedtechadd.price.focus();
		return false;
	}
	var exp = /^.+\.(jpg|gif|jpeg|JPG|JPEG|GIF|png|PNG)$/;
		if (!exp.test(document.gedtechadd.upload.value))
		{				   
			alert("Please Choose JPG OR GIF File");
			return false;
		}	
	if(!na.test(document.gedtechadd.flag.value))
	{
		alert("Gadget Flag Missing");
		document.gedtechadd.flag.focus();
		return false;
	}
	
	
}

</script>
<form name="gedtechadd" method="post" enctype="multipart/form-data" action="index.php?tc=gedtech_addcode" onSubmit="return Validate();">
<?php
if($_REQUEST['_e'] == 2)
{ ?>
	<table align="center" border="0">
	<tr>
    	<td align="center"><div class="sucmsg"><img src="images/information.png" align="absmiddle" />&nbsp;Gadget submitted successfully.</div></td>
    </tr>    
    </table>
<?php } ?>
<?php
if($_REQUEST['_e'] == 1)
{ ?>
	<table align="center" border="0">
	<tr>
    	<td align="center"><div class="sucmsg"><img src="images/information.png" align="absmiddle" />&nbsp;Invalid file format.</div></td>
    </tr>    
    </table>
<?php } ?>
<table width="99%" align="center" border="0"  class="list">
<thead>
<tr>
	<td colspan="2" align="left">
        <div style="float:left" class="righthead">Getget  Details</div>
        <div style="float:right"><a href="index.php?tc=gadgettech" class="back">Back</a></div>
    </td>
</tr>
</thead>
<tr>
	<td align="right" width="250">Store</td>
    <td align="left"><input class="text" name="store" type="text"/></td>
</tr>
<tr>
	<td align="right" width="250">Store Url</td>
    <td align="left"><input class="text" name="url" type="text"/></td>
</tr>
<tr>
	<td align="right" width="250">Gadget</td>
    <td align="left">
     <select name="gad" id="gad" class="txtborder" style="width:200px;">
    <?php 
	 $ads=mysql_query("select * from gadget where active_status='1' order by gadget_id ASC");
	while($tech=mysql_fetch_array($ads)){
	?>
    <option <?php if($edit['gadget_name']==$tech['gadget_id']){echo "selected";}?> value="<?php echo $tech['gadget_id']?>">
	<?php echo $tech['gadget_name']?></option>
    <?php }?>
    </select>
    </td>
</tr>
<tr>
	<td align="right" width="250">Make *</td>
    <td align="left"><input class="text" name="make" type="text"/></td>
</tr
><tr>
	<td align="right" width="250" valign="top">Specifications</td>
    <td align="left">
    <textarea name="maincont" id="maincont" class="textarea" cols="45" rows="8"></textarea>
        <script type="text/javascript">CKEDITOR.replace( 'maincont',{skin : 'kama'});</script>
    </td>
</tr>
<tr>
	<td align="right" width="250">Price * $</td>
    <td align="left"><input class="text" name="price" type="text"/></td>
</tr>

<tr>
	<td align="right" width="250">Image *</td>
    <td align="left"><input class="text" name="upload" type="file"/></td>
</tr>

<tr>
	<td align="right" width="250">Sale Flag *</td>
    <td align="left"><input class="text" name="flag" type="text"/>Ex:(New,Second hand etc)</td>
</tr
><tr>
  <td align="right" width="150">Status :</td>
  <td align="left">
  <input name="authorised" type="radio" value=1 checked="checked" />&nbsp;Active&nbsp;&nbsp;
  <input  name="authorised" type="radio" value=0 />&nbsp;Deactive</td>
</tr>


<tr>
	<td align="right" width="150"></td>
    <td align="left"><input type="submit" value="Submit" name="save_gadgettech">&nbsp;<input type="reset" name="reset" value="Clear" /></td>
</tr>
</table>
</form>